package site.zhanjingbo.shop.meta;

import org.apache.commons.lang3.StringEscapeUtils;

/**
 * 商品基础类
 * 
 * @author zhanjingbo
 *
 */
public class Product {
	private int id;
	private String title;
	private String summary;
	private String detail;
	private String image;
	private double price;

	private TRX trx;

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getSummary() {
		return summary;
	}

	public void setSummary(String summary) {
		this.summary = summary;
	}

	public String getDetail() {
		return detail;
	}

	public void setDetail(String detail) {
		this.detail = detail;
	}

	public String getImage() {
		return image;
	}

	public void setImage(String image) {
		this.image = image;
	}

	public double getPrice() {
		return price;
	}

	public void setPrice(double price) {
		this.price = price;
	}

	public TRX getTrx() {
		return trx;
	}

	public void setTrx(TRX trx) {
		this.trx = trx;
	}

	public boolean getIsBuy() {
		return !(this.trx == null);
	}

	public boolean getIsSell() {
		return !(this.trx == null);
	}

	public double getBuyPrice() {
		if (this.trx != null) {
			return this.trx.getPrice();
		}
		return 0;
	}

	public long getBuyTime() {
		if (this.trx != null) {
			return this.trx.getTime();
		}
		return 0;
	}
}